﻿<UserControl 
    x:Class="TfsWorkbench.NotePadUI.DisplayMode"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:filterObjects2="clr-namespace:TfsWorkbench.UIElements.FilterObjects;assembly=TfsWorkbench.UIElements"
    xmlns:scratchPadUi="clr-namespace:TfsWorkbench.NotePadUI"
    xmlns:properties="clr-namespace:TfsWorkbench.NotePadUI.Properties"
    xmlns:uiElements="clr-namespace:TfsWorkbench.NotePadUI.UIElements"
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=scratchPadUi:DisplayModeController}"
    x:Name="PART_DisplayMode">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/TfsWorkbench.UIElements;Component/Resources/ApplicationStyles.xaml"/>
                <ResourceDictionary Source="/TfsWorkbench.UIElements;Component/Resources/CommandButtonStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Border Style="{StaticResource MainBorderStyle}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>

            <Border Margin="0,0,0,2" Background="{DynamicResource ToolbarBackground}" Padding="10" CornerRadius="5" Effect="{DynamicResource DropShadowLevel1}">
                <WrapPanel Orientation="Horizontal">
                    <StackPanel Orientation="Horizontal" ToolTip="Scale scratch pad view.">
                        <TextBlock VerticalAlignment="Center" Margin="0,0,2,0">
                            <Run Text="Scale:"/>
                        </TextBlock>
                        <Slider 
                            x:Name="PART_ScaleSlider" 
                            Width="125" 
                            Minimum="0.075" 
                            Maximum="2" 
                            Value="{Binding Source={x:Static properties:Settings.Default}, Path=DisplayModeScale, Mode=TwoWay}" 
                            />
                    </StackPanel>
                    <filterObjects2:FilterTreeView 
                        Height="23"
                        x:Name="PART_FiltersControl"
                        FilterCollection="{Binding Path=FilterCollection}"
                        ToolTip="Select the scratch pad items."
                        Margin="2,0,0,0"
                        />

                    <uiElements:StickyNoteSelector
                        DataContext="{Binding}"
                        Width="125"
                        Height="23"
                        />

                    <Button 
                        Style="{DynamicResource AddButtonStyle}" 
                        Command="{Binding CreateToDoList}"
                        Content="To Do List" 
                        ToolTip="Create a new TODO list" 
                        Margin="2,0,0,0" 
                        />

                    <Button 
                        Style="{DynamicResource RefreshButtonStyle}" 
                        Command="{Binding ResetCommand}"
                        Content="Clear" 
                        ToolTip="Clear all items." 
                        Margin="2,0,0,0" 
                        />

                    <Button 
                        Style="{DynamicResource SaveButtonStyle}" 
                        Command="{x:Static scratchPadUi:LocalCommandLibrary.SaveLayoutCommand}"
                        Content="Save" 
                        ToolTip="Save the note pad view layout." 
                        Margin="2,0,0,0" 
                        />
                    
                </WrapPanel>
            </Border>

            <Border Grid.Row="1" Margin="0,5,0,0">
                <Grid>
                    <TextBlock FontStyle="Italic" Foreground="{DynamicResource DisplayModeTextColour}">
                        <Run Text="Hint: Resize and rotate notes by dragging their edge." />
                        <LineBreak />
                    </TextBlock>
                    <ScrollViewer 
                        x:Name="PART_LayoutScroller" 
                        HorizontalScrollBarVisibility="Auto" 
                        PreviewMouseWheel="ScrollViewerPreviewMouseWheel" 
                        Background="#01ffffff">
                        <Canvas x:Name="PART_LayoutCanvas" Background="Transparent">
                            <Canvas.LayoutTransform>
                                <ScaleTransform ScaleX="{Binding Value, ElementName=PART_ScaleSlider}" ScaleY="{Binding Value, ElementName=PART_ScaleSlider}" />
                            </Canvas.LayoutTransform>
                        </Canvas>
                    </ScrollViewer>
                </Grid>
            </Border>

        </Grid>
    </Border>
</UserControl>
